package thread;

public class ThreadDemo24 {
    public static void main(String[] args) {
        Thread t1=new Thread(()->{
           while (Thread.currentThread().isInterrupted()){
               System.out.println("t1线程");
               try {
                   Thread.sleep(1000);
               } catch (InterruptedException e) {
                   break;
               }
           }
        });

        t1.start();
        t1.interrupt();
    }
}
